package com.yixun.qfbao.xf.model.dto;

import com.alibaba.fastjson.JSONArray;
import org.springframework.util.StringUtils;

import java.util.List;

public class CommissionJsonDto {

	private String name;

	private String type;

	private String typeValue;

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public String getTypeValue() {
		return typeValue;
	}

	public void setTypeValue(String typeValue) {
		this.typeValue = typeValue;
	}

	public static CommissionJsonDto toJSON(String json) {
		if (!StringUtils.isEmpty(json)) {
			List<CommissionJsonDto> obj = JSONArray.parseArray(json, CommissionJsonDto.class);
			return obj == null || obj.isEmpty() ? null : obj.get(0);
		}
		return new CommissionJsonDto();
	}
}
